home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / LIB211.ZIP;1 / CONTRIB.TXT < prev    next >
Encoding:
Text File  |  1993-12-14  |  6.1 KB  |  112 lines

  1.                      Standards of the dUFLP Library
  2.                         (written by Jay Parsons)
  3.  
  4.         The purpose of this library is to assist programmers using the 
  5. dBASE language, preferably users of the Borland dBASE products.  
  6. Contributions of neat ways to do new things, better ways to do old 
  7. things or just handy routines are earnestly requested.  Once accepted, 
  8. all such routines are considered placed in the public domain, but 
  9. support from the contributor will be appreciated and may be requested.
  10.  
  11.         In order to make the library as useful as possible, please have 
  12. your contributions adhere to the following standards, which are goals 
  13. more than rules:
  14.  
  15.         Modularity - Contributions should be of procedures or functions 
  16. that can be used, as far as possible, in any context within the versions
  17. of dBASE for which written.  Where use of external global variables or 
  18. files opened before calling the routine is inevitable, the routine 
  19. header should specify the required environment.
  20.  
  21.         Style - Please use the header form, styles of capitalization
  22. and naming of variables and other conventions set forth in DHUNG2.TXT
  23. (now available as part of the dUFLP package). This makes it much easier 
  24. for readers of items contributed from different sources to find the 
  25. information they need; it may also be required by library-management 
  26. programs to assure the inclusion of called routines in files to which 
  27. the calling routines are copied.
  28.  
  29.         Encapsulation - Routines that can reasonably operate without 
  30. changing any external variables, active windows, etc., without printing
  31. to the screen, a printer or a file and without changing any dBASE "SET" 
  32. items should do so.  ALL VARIABLES CREATED WITHIN A ROUTINE SHOULD BE 
  33. "PRIVATE", AND ALL PARAMETERS LEFT UNCHANGED, to keep changes made 
  34. within from affecting the outside world.  Any departures from complete
  35. encapsulation, such as opening or closing files, input, output, 
  36. changing "SET" items or work areas should be noted in the header. This
  37. does not mean a routine should not change such items, but that if it 
  38. does it should restore them to the starting status if it reasonably 
  39. can.  This standard is necessarily subjective.  One of the nicer 
  40. routines ( CURRPORT() ) in this release is a workaround for the failure 
  41. of dBASE IV 1.5 to contain a printerset() function to report what file 
  42. or device PRINTER is SET to, without which it cannot be reset on exit.
  43. The workaround routine is complex and slow enough that it may be 
  44. preferable simply to note in the header of a routine using printer 
  45. redirection that the routine changes the setting, leaving it to users 
  46. to add the code needed to detect the original setting and restore it if 
  47. it matters to them. 
  48.  
  49.         Error handling - There is generally no need to handle errors 
  50. such as calling a routine with the wrong number or type of parameters.
  51. This can be left to the calling program or dBASE itself.  Handling 
  52. errors with screen displays of messages, prompts for reentry of data, 
  53. etc. is sufficiently complex that this too can usually be left to dBASE 
  54. or the calling program. However, in no case should a function return a 
  55. value as an error code that might be mistaken for a valid result, such 
  56. as 0 for the average of numbers in an array if there are no such numbers
  57. or array.  Something available to the calling routine after the return 
  58. should be provided that will, if inspected by the calling routine, give 
  59. it notice that an error has occurred.  And, of course, the manner in 
  60. which the calling routine should check for an error should be documented
  61. in the header if not obvious.
  62.  
  63.         Planning ahead - The library contains many fine routines that 
  64. are somewhat obsolete.  If contributing one for the future, try to 
  65. anticipate changes.  A center() function that takes a string of 
  66. characters and prints it in the middle of an 80 x 25 screen is nice, but
  67. one that also takes the width and returns the string padded with blanks 
  68. on the left or both ends to the given width is probably better, because
  69. it supports use with screens of other widths or heights, printing the 
  70. resulting string to a file and other variations.  This too is 
  71. subjective, as anticipating unlikely contingencies will require extra 
  72. and slowing code.
  73.  
  74.         This is your library.  Enjoy it, contribute what you can, and 
  75. please report any bugs or other unexpected results to:
  76.  
  77.  
  78. Specific Requests:
  79.   1) Use spaces, rather than tabs. If needed, check with Keith Chuvala,
  80.      who has a nifty little routine called TABCVT.EXE that will
  81.      convert your tabs for you. Also, please, for consistency, use
  82.      3 spaces for your indents if at all possible.
  83.   2) Always use the prefix "m->" for your memory variables.
  84.   3) Always end your macros with a dot (¯oname.)
  85.   4) Set your margin to 72 characters maximum for both your documentation
  86.      and your code.
  87.   5) Do not assign a value to a macro as:
  88.      ¯o. = <value>
  89.        The compiler will choke on this. Instead, use:
  90.      store <value> to ¯o.
  91.   6) Please use the header AS SHOWN the end of DHUNG2.TXT included
  92.      with this library. 
  93.  
  94. =======================================================================
  95. NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE NOTE
  96.  
  97.      In order to keep the dUFLP library working in a manner that
  98.      helps the users, we have decided to create four separate
  99.      versions of the library. One will be for dBASE IV, 1.1, one
  100.      for dBASE IV, 1.5, one for dBASE IV, 2.0 and one for dBW. One of 
  101.      the reasons for this is to avoid the necessity of keeping 
  102.      outdated routines in the later versions of the library. For
  103.      example, in dBASE IV, 1.5, there was no RAT() function, so one 
  104.      was created. In dBASE IV, 2.0 there is an internal function 
  105.      called RAT(), and therefore there is no need for the external 
  106.      (dUFLP) function to be contained in the dUFLP library for dBASE 
  107.      IV, 2.0 as well.
  108.  
  109.      ALL DETAILS ON THIS ARE IN NEWS.TXT
  110. =======================================================================
  111.  
  112.